
<div class="warp head">
	<h1><a href=""><img src="/public/novel/images/logo.png" alt=""></a></h1>
	<div class="search">
		<input type="text" name="keysWord" id="keysWord" value="" placeholder="请输入书名/作者"><span id="subkeys"></span>
	</div>
	{if $Think.session.user_auth.uid}
		<div class="login">
			<a href="/personal/info/">{$Think.session.user_auth.uid|get_nickname}</a> / <a href="/logout">退出</a>
		</div>
	{else}
		{if $nav !="Login/index"}
			<div class="login">
				<a id="loginPhone">登陆／注册</a>
			</div>
		{/if}
	{/if}
	
	<div class="writing"><a onclick="gowrites()">写作</a></div>
</div>

<div class="nav">
	<div class="warp">
		<a href="/" class="{if isset($nav) && $nav=='index'}cur{/if}">首页</a>
        <a href="/books" class="{if isset($nav) && $nav=='bookall'}cur{/if}">书库</a>
        <a href="/top" class="{if isset($nav) && $nav=='booktop'}cur{/if}">排行</a>
		
        <a onclick="gopay()" class="{if isset($nav) && $nav=='payindex'}cur{/if}">充值</a>
		<a href="/personal/bookcase" class="my">我的书架</a>
	</div>
</div>

<script type="text/javascript">
	var is_login = {if $Think.session.user_auth.uid>0}1{else/}0{/if};
    $(document).ready(function(){
        $("#subkeys").click(function(){
            var keyName=$("#keysWord").val();
            location.href="/books?channel=0&cate=&fullflag=&upday=&keyword="+keyName;
        });
    });

    function gopay(){
		if (is_login>0)
		{
			window.location.href = '/pay/index';
			return false;
		}else{
			$.loginBox('/pay/index');
			return false;
		}
		
    }
	function gowrites(){
		if (is_login>0)
		{
			window.location.href = "{:config('writer_url')}";
			return false;
		}else{
			$.loginBox('/pay/index');
			return false;
		}
    }
</script>